﻿# ==============================================================================
# 版权与授权声明（Copyright and License Statement）
# 中文：Copyright (c) 2025 zaohuasage（欧阳/Yang Ou）
# 英文：Copyright (c) 2025 zaohuasage (Yang Ou)
# 
# 中文：本项目及所有子模块（含代码、数据、文档）基于 Apache License 2.0 协议开源，完整授权条款见根目录 LICENSE.md 文件，补充规则见根目录 NOTICE.md 文件；两者共同构成授权依据，使用本项目任何部分即视为接受全部条款。
# 英文：This project and all its sub-modules (including code, data, documents) are open-sourced under the Apache License 2.0. The complete license terms are available in the LICENSE.md file in the root directory, and supplementary rules are in the NOTICE.md file in the root directory; both together constitute the basis for authorization, and use of any part of this project shall be deemed acceptance of all terms.
# 
# 中文：允许场景：学术研究、教育科普、非商业性基础原理验证（商用需额外联系作者授权）；禁止场景：军事及国防用途、伪科学宣传（如“量子玄学”“量子治病”）、违法违规行为。
# 英文：Permitted Scenarios: Academic research, educational popularization, non-commercial verification of basic principles (commercial use requires additional authorization by contacting the author); Prohibited Scenarios: Military and national defense-related uses, pseudoscientific promotion (e.g., "quantum metaphysics", "quantum healing"), and illegal or non-compliant acts.
# 
# 中文：作者学术标识：ORCID: 0009-0009-2218-019X（https://orcid.org/0009-0009-2218-019X）；联系邮箱：okk4983070@163.com
# 英文：Author's Academic ID: ORCID: 0009-0009-2218-019X (https://orcid.org/0009-0009-2218-019X); Contact Email: okk4983070@163.com
# ==============================================================================
from qiskit import QuantumCircuit
from qiskit_aer import AerSimulator

# 创建|Φ⁺⟩贝尔态电路（最基础的贝尔态）
qc = QuantumCircuit(2, 2)
qc.h(0)       # Hadamard门作用于第一个量子比特
qc.cx(0, 1)   # CNOT门，控制位0，目标位1
qc.measure([0,1], [0,1])

# 打印电路
print("贝尔态|Φ⁺⟩电路：")
print(qc.draw(output='text'))

# 模拟测量
simulator = AerSimulator()
result = simulator.run(qc, shots=1000000).result()
counts = result.get_counts()
print("测量结果：", counts)
